﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="XmlComparisonTabConfigElement.cs" company="" />
// <summary>
//   Configuration element for the XML comparison tab.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Xompare.Configuration
{
    using System.Configuration;

    /// <summary>
    /// Configuration element for the XML comparison tab.
    /// </summary>
    public class XmlComparisonTabConfigElement : ConfigurationElement
    {
        public const string CElementName = "XmlComparisonTab";

        #region Configuration field names

        private const string c_ignoreNameCase = "ignoreNameCase";
        private const string c_ignoreValueCase = "ignoreValueCase";
        private const string c_ignoreWhiteSpaces = "ignoreWhiteSpaces";

        #endregion

        public override bool IsReadOnly()
        {
            return false;
        }

        /// <summary>
        /// Gets or sets whether to ignore the XML objects' name casing on XML comparison.
        /// </summary>
        [ConfigurationProperty(c_ignoreNameCase, IsRequired = true)]
        public bool IgnoreNameCase
        {
            get
            {
                return (bool)this[c_ignoreNameCase];
            }

            set
            {
                this[c_ignoreNameCase] = value;
            }
        }

        /// <summary>
        /// Gets or sets whether to ignore the XML objects' value casing on XML comparison.
        /// </summary>
        [ConfigurationProperty(c_ignoreValueCase, IsRequired = true)]
        public bool IgnoreValueCase
        {
            get
            {
                return (bool)this[c_ignoreValueCase];
            }

            set
            {
                this[c_ignoreValueCase] = value;
            }
        }

        /// <summary>
        /// Gets or sets whether to ignore the XML objects' white spacing on XML comparison.
        /// </summary>
        [ConfigurationProperty(c_ignoreWhiteSpaces, IsRequired = true)]
        public bool IgnoreWhiteSpaces
        {
            get
            {
                return (bool)this[c_ignoreWhiteSpaces];
            }

            set
            {
                this[c_ignoreWhiteSpaces] = value;
            }
        }
    }
}
